Dynomotion

Group: DynoMotion Message: 444 From: fermanz Date: 6/14/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
Thanks Tom,
We are going to use a four way switch for the speed control and cut the 5V to disable the encoders in the switch "Off" position.

Correct on the second point with axes 0 and 1.

You may have to clarify the implementation of the "if" condition :)
I can figure that you mean just around the section of code, relating to the handwheels, in the init.c file.
Just give me an example of the "if" format please.

I am a proponent of the "give it a go" philosophy so let's try it and find out what happens.

Ross

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ross,
>
> Yes the code to do the speed selection is left in.  You can delete it (and set a fixed speed Factor) if you don't have a speed switch.
>
> Yes the two hand wheels are fixed to axis0 and axis1.  I assume that is what you want.
>
> No - there is no enable switch, but disabling the handwheels would be easy.  Just put a "if" condition around the whole block of code.  But I'm not sure how to disable Mach3's keyboard.  It seems to me unlikely that an operator would type something while turning the handwheels.  But I do think it would be possible for someone to bump a handwheel while GCode is running.  I think this might be protected already because a motion trajectory controlling the commanded destination will overwrite any changes a User program tries to make to the commanded destinations.
>
> Another approach would be to use the Mach3 Offline mode to enable the handwheels.  Does that sound like a good idea?
>
> But let's get it all working first, then we can work on the more subtle details. 
>
> TK
>
>  
>
>
>
> ________________________________
> From: fermanz <ferman@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sun, June 13, 2010 12:48:12 PM
> Subject: [DynoMotion] Re: Collision or not?
>
>  
> Thanks Tom,
> I knew there would be some simple parts to the answer :)
> I see that we retain the speed selection of x, x10, and x100.
> I take it we no longer select an axis?
> And we enable both handwheels with one on/off switch.
> Is there something in the code that disables all other inputs, such as keyboard, or MDI, etc. as soon as the handwheels are enabled?
>
> Ross
>
> P.S. I can't find the Init3AnalogPlusTwoMPGs.c file attached, although I can just copy and paste it from here.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ross/Bengt
> >
> > Regarding PoKeys: Yes as far as I know it should work with KFlop and/or in parallel with some other MPG as it basically issues commands to Mach3, so from KFlop's standpoint it is no different then pushing buttons directly on the screen to cause movement and events.  I think both can be "active" at the same time (use one then
>
> <<<<clipped>>>>>
> >
>
Group: DynoMotion Message: 445 From: Tom Kerekes Date: 6/14/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
Hi Ross,
 
I'm not sure I understand what you mean by "cut the 5V".  Turning off the power to the encoders probably isn't a good idea as that is likely to cause the A/B outputs to glitch during power down.
 
Better to just run the enable switch into an input and use that input as an "if" condition to allow the destinations to be changed.  The format for an "if" statement to skip stuff based on an input bit is:
 
 
if (ReadBit(xx))
{
    // this is only executed if bit xx is 1
}
TK
 

 
Group: DynoMotion Message: 446 From: fermanz Date: 6/14/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
I hope I never get tired of saying you were right again Tom!
The outputs did glitch - but at least we now have the handwheels working, although not able to disable them.
We have reset the off position to enable bit#30 and I have tried the "if" statement but clearly I have not got it right as we are still getting movement as if the switch is on the X10 position, which we don't have connected at all - as your clever C file setup requires
We are also getting a Dynomotion status message, in Mach3, saying that the Z axis is disabled.
I have attached the Hankook Init.c file for your perusal so that you can give me another lesson in c, hopefully :)
Ross

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ross,
>
> I'm not sure I understand what you mean by "cut the 5V".  Turning off the power to the encoders probably isn't a good idea as that is likely to cause the A/B outputs to glitch during power down.
>
> Better to just run the enable switch into an input and use that input as an "if" condition to allow the destinations to be changed.  The format for an "if" statement to skip stuff based on an input bit is:
>
>
> if (ReadBit(xx))
> {
>     // this is only executed if bit xx is 1
> }
>
> TK
>
>
>  
>
> ________________________________
> From: fermanz <ferman@...>
> To: DynoMotion@yahoogroups.com
> Sent: Mon, June 14, 2010 2:41:32 PM
> Subject: [DynoMotion] Re: Handwheel connecting - formerly Collision or not?
>
>  
> Thanks Tom,
> We are going to use a four way switch for the speed control and cut the 5V to disable the encoders in the switch "Off" position.
>
> Correct on the second point with axes 0 and 1.
>
> You may have to clarify the implementation of the "if" condition :)
> I can figure that you mean just around the section of code, relating to the handwheels, in the init.c file.
> Just give me an example of the "if" format please.
>
> I am a proponent of the "give it a go" philosophy so let's try it and find out what happens.
>
> Ross
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ross,
> >
> > Yes the code to do the speed selection is left in.  You can delete it (and set a fixed speed Factor) if you don't have a speed switch.
> >
> > Yes the two hand wheels are fixed to axis0 and axis1.  I assume that is what you want.
> >
> > No - there is no enable switch, but disabling the handwheels would be easy.  Just put a "if" condition around the whole block of code.  But I'm not sure how to disable Mach3's keyboard.  It seems to me unlikely that an operator would type something while turning the handwheels.  But I do think it would be possible for someone to bump a handwheel while GCode is running.  I think this might be protected already because a motion trajectory controlling the commanded destination will overwrite any changes a User program tries to make to the commanded destinations.
> >
> > Another approach would be to use the Mach3 Offline mode to enable the handwheels.  Does that sound like a good idea?
> >
> > But let's get it all working first, then we can work on the more subtle details. 
> >
> > TK
> >
> >  
> >
> >
> >
> > ________________________________
> > From: fermanz <ferman@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sun, June 13, 2010 12:48:12 PM
> > Subject: [DynoMotion] Re: Collision or not?
> >
> >  
> > Thanks Tom,
> > I knew there would be some simple parts to the answer :)
> > I see that we retain the speed selection of x, x10, and x100.
> > I take it we no longer select an axis?
> > And we enable both handwheels with one on/off switch.
> > Is there something in the code that disables all other inputs, such as keyboard, or MDI, etc. as soon as the handwheels are enabled?
> >
> > Ross
> >
> > P.S. I can't find the Init3AnalogPlusTwoMPGs.c file attached, although I can just copy and paste it from here.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ross/Bengt
> > >
> > > Regarding PoKeys: Yes as far as I know it should work with KFlop and/or in parallel with some other MPG as it basically issues commands to Mach3, so from KFlop's standpoint it is no different then pushing buttons directly on the screen to cause movement and events.  I think both can be "active" at the same time (use one then
> >
> > <<<<clipped>>>>>
> > >
> >
>
Group: DynoMotion Message: 447 From: Tom Kerekes Date: 6/14/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
I think you forgot to attach the file. 
 
TK

Group: DynoMotion Message: 448 From: fermanz Date: 6/15/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
I didn't forget Tom - I just couldn't see how to attach a file, simply, to a message.
I can figure how to post a file but I see how that 'attaches' to a particular message.
I was almost going to slip back into the "Clunky Forum" diatribe here but decided against that and went off to remind myself how easy it is on other forums, such as the MachSupport one, and I posted a message there and was pleased to be able to promote your product and excellent service.
The only thing I can possibly chide you on is this bloody useless forum format that Yahoo foists upon us and frustrates me so much.

I sent you the file via email - I know how to do that :)

Ross

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> I think you forgot to attach the file. 
>
> TK
>
>
>
>
> ________________________________
> From: fermanz <ferman@...>
> To: DynoMotion@yahoogroups.com
> Sent: Mon, June 14, 2010 9:55:11 PM
> Subject: [DynoMotion] Re: Handwheel connecting - formerly Collision or not?
>
>  
> I hope I never get tired of saying you were right again Tom!
> The outputs did glitch - but at least we now have the handwheels working, although not able to disable them.
> We have reset the off position to enable bit#30 and I have tried the "if" statement but clearly I have not got it right as we are still getting movement as if the switch is on the X10 position, which we don't have connected at all - as your clever C file setup requires
> We are also getting a Dynomotion status message, in Mach3, saying that the Z axis is disabled.
> I have attached the Hankook Init.c file for your perusal so that you can give me another lesson in c, hopefully :)
> Ross
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ross,
> >
> > I'm not sure I understand what you mean by "cut the 5V".  Turning off the power to the encoders probably isn't a good idea as that is likely to cause the A/B outputs to glitch during power down.
> >
> > Better to just run the enable switch into an input and use that input as an "if" condition to allow the destinations to be changed.  The format for an "if" statement to skip stuff based on an input bit is:
> >
> >
> > if (ReadBit(xx))
> > {
> >     // this is only executed if bit xx is 1
> > }
> >
> > TK
> >
> >
> >  
> >
> > ________________________________
> > From: fermanz <ferman@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Mon, June 14, 2010 2:41:32 PM
> > Subject: [DynoMotion] Re: Handwheel connecting - formerly Collision or not?
> >
> >  
> > Thanks Tom,
> > We are going to use a four way switch for the speed control and cut the 5V to disable the encoders in the switch "Off" position.
> >
> > Correct on the second point with axes 0 and 1.
> >
> > You may have to clarify the implementation of the "if" condition :)
> > I can figure that you mean just around the section of code, relating to the handwheels, in the init.c file.
> > Just give me an example of the "if" format please.
> >
> > I am a proponent of the "give it a go" philosophy so let's try it and find out what happens.
> >
> > Ross
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ross,
> > >
> > > Yes the code to do the speed selection is left in.  You can delete it (and set a fixed speed Factor) if you don't have a speed switch.
> > >
> > > Yes the two hand wheels are fixed to axis0 and axis1.  I assume that is what you want.
> > >
> > > No - there is no enable switch, but disabling the handwheels would be easy.  Just put a "if" condition around the whole block of code.  But I'm not sure how to disable Mach3's keyboard.  It seems to me unlikely that an operator would type something while turning the handwheels.  But I do think it would be possible for someone to bump a handwheel while GCode is running.  I think this might be protected already because a motion trajectory controlling the commanded destination will overwrite any changes a User program tries to make to the commanded destinations.
> > >
> > > Another approach would be to use the Mach3 Offline mode to enable the handwheels.  Does that sound like a good idea?
> > >
> > > But let's get it all working first, then we can work on the more subtle details. 
> > >
> > > TK
> > >
> > >  
> > >
> > >
> > >
> > > ________________________________
> > > From: fermanz <ferman@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Sun, June 13, 2010 12:48:12 PM
> > > Subject: [DynoMotion] Re: Collision or not?
> > >
> > >  
> > > Thanks Tom,
> > > I knew there would be some simple parts to the answer :)
> > > I see that we retain the speed selection of x, x10, and x100.
> > > I take it we no longer select an axis?
> > > And we enable both handwheels with one on/off switch.
> > > Is there something in the code that disables all other inputs, such as keyboard, or MDI, etc. as soon as the handwheels are enabled?
> > >
> > > Ross
> > >
> > > P.S. I can't find the Init3AnalogPlusTwoMPGs.c file attached, although I can just copy and paste it from here.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ross/Bengt
> > > >
> > > > Regarding PoKeys: Yes as far as I know it should work with KFlop and/or in parallel with some other MPG as it basically issues commands to Mach3, so from KFlop's standpoint it is no different then pushing buttons directly on the screen to cause movement and events.ÃÆ'‚  I think both can be "active" at the same time (use one then
> > >
> > > <<<<clipped>>>>>
> > > >
> > >
> >
>
Group: DynoMotion Message: 449 From: fermanz Date: 6/15/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
Hi Tom,
The updated Init file worked perfectly, although I did have to include the ! - thus
if (!ReadBit(30))
{
// this is only executed if handwheels are enabled
// bit #30 is disabled

However, upon reflection, and as we have wires to spare, could we not have done this -

// Read Speed Selector

if (ReadBit(30)) // is X1 selected?
Factor = 1.0;
else if (ReadBit(31)) // is X10 selected?
Factor = 10.0;
else if (ReadBit(32)) // is X100 selected
Factor = 75.0;



ch0->Dest += Change1 * Factor;
ch1->Dest += Change1_2 * Factor;

In the off position nothing is connected/enabled.
Any problems with that?

Ross


--- In DynoMotion@yahoogroups.com, "fermanz" <ferman@...> wrote:
>
> I hope I never get tired of saying you were right again Tom!
> The outputs did glitch - but at least we now have the handwheels working, although not able to disable them.
> We have reset the off position to enable bit#30 and I have tried the "if" statement but clearly I have not got it right as we are still getting movement as if the switch is on the X10 position, which we don't have connected at all - as your clever C file setup requires
> We are also getting a Dynomotion status message, in Mach3, saying that the Z axis is disabled.
> I have attached the Hankook Init.c file for your perusal so that you can give me another lesson in c, hopefully :)
> Ross
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ross,
> >
> > I'm not sure I understand what you mean by "cut the 5V".  Turning off the power to the encoders probably isn't a good idea as that is likely to cause the A/B outputs to glitch during power down.
> >
> > Better to just run the enable switch into an input and use that input as an "if" condition to allow the destinations to be changed.  The format for an "if" statement to skip stuff based on an input bit is:
> >
> >
> > if (ReadBit(xx))
> > {
> >     // this is only executed if bit xx is 1
> > }
> >
> > TK
> >
> >
> >  
> >
> > ________________________________
> > From: fermanz <ferman@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Mon, June 14, 2010 2:41:32 PM
> > Subject: [DynoMotion] Re: Handwheel connecting - formerly Collision or not?
> >
> >  
> > Thanks Tom,
> > We are going to use a four way switch for the speed control and cut the 5V to disable the encoders in the switch "Off" position.
> >
> > Correct on the second point with axes 0 and 1.
> >
> > You may have to clarify the implementation of the "if" condition :)
> > I can figure that you mean just around the section of code, relating to the handwheels, in the init.c file.
> > Just give me an example of the "if" format please.
> >
> > I am a proponent of the "give it a go" philosophy so let's try it and find out what happens.
> >
> > Ross
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ross,
> > >
> > > Yes the code to do the speed selection is left in.  You can delete it (and set a fixed speed Factor) if you don't have a speed switch.
> > >
> > > Yes the two hand wheels are fixed to axis0 and axis1.  I assume that is what you want.
> > >
> > > No - there is no enable switch, but disabling the handwheels would be easy.  Just put a "if" condition around the whole block of code.  But I'm not sure how to disable Mach3's keyboard.  It seems to me unlikely that an operator would type something while turning the handwheels.  But I do think it would be possible for someone to bump a handwheel while GCode is running.  I think this might be protected already because a motion trajectory controlling the commanded destination will overwrite any changes a User program tries to make to the commanded destinations.
> > >
> > > Another approach would be to use the Mach3 Offline mode to enable the handwheels.  Does that sound like a good idea?
> > >
> > > But let's get it all working first, then we can work on the more subtle details. 
> > >
> > > TK
> > >
> > >  
> > >
> > >
> > >
> > > ________________________________
> > > From: fermanz <ferman@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Sun, June 13, 2010 12:48:12 PM
> > > Subject: [DynoMotion] Re: Collision or not?
> > >
> > >  
> > > Thanks Tom,
> > > I knew there would be some simple parts to the answer :)
> > > I see that we retain the speed selection of x, x10, and x100.
> > > I take it we no longer select an axis?
> > > And we enable both handwheels with one on/off switch.
> > > Is there something in the code that disables all other inputs, such as keyboard, or MDI, etc. as soon as the handwheels are enabled?
> > >
> > > Ross
> > >
> > > P.S. I can't find the Init3AnalogPlusTwoMPGs.c file attached, although I can just copy and paste it from here.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ross/Bengt
> > > >
> > > > Regarding PoKeys: Yes as far as I know it should work with KFlop and/or in parallel with some other MPG as it basically issues commands to Mach3, so from KFlop's standpoint it is no different then pushing buttons directly on the screen to cause movement and events.  I think both can be "active" at the same time (use one then
> > >
> > > <<<<clipped>>>>>
> > > >
> > >
> >
>
Group: DynoMotion Message: 450 From: Tom Kerekes Date: 6/15/2010
Subject: Re: Handwheel connecting - formerly Collision or not?
Ross,
 
Sorry don't follow that.  Maybe you meant:
 

if (ReadBit(30)) // Are we disabled?
Factor = 0.0;
else if (ReadBit(31)) // is X10 selected?
Factor = 10.0;
else if (ReadBit(32)) // is X100 selected
Factor = 75.0;

TK